﻿<!DOCTYPE html
  PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- saved from url=(0014)about:internet -->
<html xmlns:MSHelp="http://www.microsoft.com/MSHelp/" lang="en-us" xml:lang="en-us"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

<meta name="DC.Type" content="topic">
<meta name="DC.Title" content="Namespaces">
<meta name="DC.subject" content="Namespaces, tbb, tbb::interface, tbb::interfacex, tbb::internal, tbb::deprecated, tbb::strict_ppl, TBB_DEPRECATED">
<meta name="keywords" content="Namespaces, tbb, tbb::interface, tbb::interfacex, tbb::internal, tbb::deprecated, tbb::strict_ppl, TBB_DEPRECATED">
<meta name="DC.Relation" scheme="URI" content="../../reference/general_conventions.htm">
<meta name="DC.Format" content="XHTML">
<meta name="DC.Identifier" content="namespaces">
<meta name="DC.Language" content="en-US">
<link rel="stylesheet" type="text/css" href="../../intel_css_styles.css">
<title>Namespaces</title>
<xml>
<MSHelp:Attr Name="DocSet" Value="Intel"></MSHelp:Attr>
<MSHelp:Attr Name="Locale" Value="kbEnglish"></MSHelp:Attr>
<MSHelp:Attr Name="TopicType" Value="kbReference"></MSHelp:Attr>
</xml>
</head>
<body id="namespaces">
 <!-- ==============(Start:NavScript)================= -->
 <script src="..\..\NavScript.js" language="JavaScript1.2" type="text/javascript"></script>
 <script language="JavaScript1.2" type="text/javascript">WriteNavLink(2);</script>
 <!-- ==============(End:NavScript)================= -->
<a name="namespaces"><!-- --></a>

 
  <h1 class="topictitle1">Namespaces</h1>
 
   
  <div> 
	 <p>This section describes the library's namespace conventions. 
	 </p>
 
	 <div class="section"><h2 class="sectiontitle"><samp class="codeph">tbb</samp> Namespace</h2> 
		 
		<p>Namespace 
		  <samp class="codeph">tbb</samp> contains public identifiers defined by the library
		  that you can reference in your program. 
		</p>
 
	 </div>
 
	 <div class="section"><h2 class="sectiontitle"><samp class="codeph">tbb::flow</samp>
		  Namespace</h2> 
		 
		<p>Namespace 
		  <samp class="codeph">tbb::flow</samp> contains public identifiers defined by the
		  library that you can reference in your program. 
		</p>
 
		<p> related to the flow graph Community Preview Feature. See 
		  <a href="../flow_graph.htm#flow_graph">Flow Graph</a> for more information . 
		</p>
 
	 </div>
 
	 <div class="section"><h2 class="sectiontitle"><samp class="codeph">tbb::interface<em>x</em></samp>
		  Namespace</h2> 
		 
		<p>Namespaces of the form 
		  <samp class="codeph">tbb::interface<em>x</em></samp> define public identifiers that
		  the library injects into namespace 
		  <samp class="codeph">tbb</samp>. The numeral 
		  <samp class="codeph"><em>x</em></samp> corresponds to an internal version number
		  that serves to prevent accidental linkage of incompatible definitions. Your
		  code should never directly reference namespaces prefixed with 
		  <samp class="codeph">tbb::interface<em>x</em></samp>. Instead, reference names via
		  namespace 
		  <samp class="codeph">tbb</samp>. 
		</p>
 
		<p>For example the header 
		  <samp class="codeph">tbb/concurrent_hash_map.h</samp> defines the template 
		  <samp class="codeph">concurrent_hashmap&lt;Key,T&gt;</samp> as 
		  <samp class="codeph">tbb::version4::concurrent_hashmap&lt;Key,T&gt;</samp> and
		  employs a 
		  <samp class="codeph">using</samp> directive to inject it into namespace 
		  <samp class="codeph">tbb</samp>. Your source code should reference it as 
		  <samp class="codeph">tbb::concurrent_hashmap&lt;Key,T&gt;</samp>. 
		</p>
 
	 </div>
 
	 <div class="section"><h2 class="sectiontitle"><samp class="codeph">tbb::internal</samp>
		  Namespace</h2> 
		 
		<p>Namespace 
		  <samp class="codeph">tbb::internal</samp> serves a role similar to 
		  <samp class="codeph">tbb::interface<em>x</em></samp>. It is retained for backwards
		  compatibility with older versions of the library. Your code should never
		  directly reference namespace 
		  <samp class="codeph">tbb::internal</samp>. Indirect reference via a public 
		  <samp class="codeph">typedef</samp> provided by the header files is permitted. 
		</p>
 
	 </div>
 
	 <div class="section"><h2 class="sectiontitle"><samp class="codeph">tbb::deprecated</samp>
		  Namespace</h2> 
		 
		<p>The library uses the namespace 
		  <samp class="codeph">tbb::deprecated</samp> for deprecated identifiers that have
		  different default meanings in namespace 
		  <samp class="codeph">tbb</samp>. Compiling with 
		  <samp class="codeph">TBB_DEPRECATED=1</samp> causes such identifiers to replace
		  their counterpart in namespace tbb. 
		</p>
 
		<p>For example, 
		  <samp class="codeph">tbb::concurrent_queue</samp> underwent changes in
          Intel&reg; Threading Building Blocks (Intel&reg; TBB) 2.2
		  that split its functionality into 
		  <samp class="codeph">tbb::concurrent_queue</samp> and 
		  <samp class="codeph">tbb::concurrent_bounded_queue</samp> and changed the name of
		  some methods. For sake of legacy code, the old Intel&reg; TBB 2.1
		  functionality is retained in 
		  <samp class="codeph">tbb::deprecated::concurrent_queue</samp>, which is injected
		  into namespace tbb when compiled with 
		  <samp class="codeph">TBB_DEPRECATED=1</samp>. 
		</p>
 
	 </div>
 
	 <div class="section"><h2 class="sectiontitle"><samp class="codeph">tbb::strict_ppl</samp>
		  Namespace</h2> 
		 
		<p>The library uses the namespace 
		  <samp class="codeph">tbb::strict_ppl</samp> for identifiers that are put in
		  namespace 
		  <samp class="codeph">Concurrency</samp> when<samp class="codeph"> tbb/compat/ppl.h</samp> is
		  included. 
		</p>
 
	 </div>
 
	 <div class="section"><h2 class="sectiontitle"><samp class="codeph">std</samp> Namespace</h2> 
		 
		<p>The library implements some C++11 features in
		  namespace 
		  <samp class="codeph">std</samp>. The library version can be used by including the
		  corresponding header in the following table.
		</p>
 
		
<div class="tablenoborder"><a name="tbl3"><!-- --></a><table cellpadding="4" summary="" id="tbl3" width="100%" frame="hsides" border="1" rules="all"><caption><span class="tablecap">C++11 Features Optonally Defined
		  by Intel&reg; TBB.</span></caption> 
		   
		   
		   
		  <thead align="left"> 
			 <tr> 
				<th class="cellrowborder" valign="top" width="NaN%" id="d89183e256"> 
				  <p><strong>Header</strong> 
				  </p>
 
				</th>
 
				<th class="cellrowborder" valign="top" width="NaN%" id="d89183e264"> 
				  <p><strong>Identifiers Added to 
						<samp class="codeph">std::</samp></strong> 
				  </p>
 
				</th>
 
				<th class="row-nocellborder" valign="top" width="NaN%" id="d89183e274"> 
				  <p><strong>Section</strong> 
				  </p>
 
				</th>
 
			 </tr>
 
		  </thead>

		  <tbody> 
			 <tr> 
				<td class="cellrowborder" valign="top" width="NaN%" headers="d89183e256 "> 
				  <p>tbb/compat/condition_variable 
				  </p>
 
				</td>
 
				<td class="cellrowborder" valign="top" width="NaN%" headers="d89183e264 "> 
				  <p><samp class="codeph">defer_lock_t</samp> 
				  </p>
 
				  <p><samp class="codeph">try_to_lock_t</samp> 
				  </p>
 
				  <p><samp class="codeph">adopt_lock_t</samp> 
				  </p>
 
				  <p><samp class="codeph">defer_lock</samp> 
				  </p>
 
				  <p><samp class="codeph">try_to_lock</samp> 
				  </p>
 
				  <p><samp class="codeph">adopt_lock</samp> 
				  </p>
 
				  <p><samp class="codeph">lock_guard</samp> 
				  </p>
 
				  <p><samp class="codeph">unique_lock</samp> 
				  </p>
 
				  <p><samp class="codeph">swap</samp> 
				  </p>
 
				  <p><samp class="codeph">condition_variable</samp> 
				  </p>
 
				  <p><samp class="codeph">cv_status</samp> 
				  </p>
 
				  <p><samp class="codeph">timeout</samp> 
				  </p>
 
				  <p><samp class="codeph">no_timeout</samp> 
				  </p>
 
				</td>
 
				<td class="row-nocellborder" valign="top" width="NaN%" headers="d89183e274 "> 
				  <p><a href="../synchronization/c_11_synchronization.htm">C++11
						Synchronization</a> 
				  </p>
 
				</td>
 
			 </tr>
 
			 <tr> 
				<td class="cellrowborder" valign="top" width="NaN%" headers="d89183e256 "> 
				  <p>tbb/compat/thread 
				  </p>
 
				</td>
 
				<td class="cellrowborder" valign="top" width="NaN%" headers="d89183e264 "> 
				  <p><samp class="codeph">thread</samp> 
				  </p>
 
				  <p><samp class="codeph">this_thread</samp> 
				  </p>
 
				</td>
 
				<td class="row-nocellborder" valign="top" width="NaN%" headers="d89183e274 "> 
				  <p> 
					 <a href="../threads/thread_cls.htm"><samp class="codeph">thread</samp>
						Class</a> 
				  </p>
 
				</td>
 
			 </tr>
 
		  </tbody>
 
		</table>
</div>
 
		<p>To prevent accidental linkage with other
		  implementations of these C++ library features, the library defines the
		  identifiers in other namespaces and injects them into namespace 
		  <samp class="codeph">std::</samp>.&nbsp; This way the “mangled
		  name” seen by the linker will differ from the “mangled
		  name” generated by other implementations. 
		</p>
 
	 </div>
 
  </div>
 

<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong>&nbsp;<a href="../../reference/general_conventions.htm">General Conventions</a></div>
</div>
<div></div>

</body>
</html>
